#include <iostream>
#include <string>
#include <cassert>
using namespace std;

template<typename t>
class Array
{
private:
    int capcity;
    int size;
    t *array;
public:
    Array(){
        this->capcity=100;
        this->size=0;
        this->array=new t [this->capcity];
    }
    ~Array(){}
    int getsize();
    t getvalue(int temp);
    void pushback(t value);
    void sertvalue(int temp,t value);
    void deletevalue(int temp);
    void add();
    void deletel(int arr[],int len);

};

template<typename t>
void Array<t>::add()
{
    int a;
    cout<<"输入加入数据的数量"<<endl;
    cin>>a;
    for (int i=0;i<a;i++){
        t b;
        cout<<"输入加入的第"<<i+1<<"个数据"<<endl;
        cin>>b;
        this->array[this->size]=b;
        this->size++;
        cout<<this->size<<endl;
    }
}
template<typename t>
int Array<t>::getsize(){
    return this->size;
}

template<typename t>
void Array<t>::pushback(t value){
    this->array[this->size]=value;
    this->size++;
}

template<typename t>
t Array<t>::getvalue(int temp){
    return this->array[temp];
}
template<typename t>
void Array<t>::sertvalue(int temp,t value){
    this->array[temp]=value;
}

template<typename t>
void Array<t>::deletevalue(int temp){
    for(int i=temp;i<this->size-1;i++){
        this->array[i]=this->array[i+1];
    }
    this->size--;
}

template<typename t>
void Array<t>::deletel(int arr[],int len){
    for(int j=0;j<len;j++){
        int temp;
        temp=arr[len-1-j];
        for(int i=temp;i<this->size-1;i++){
            this->array[i]=this->array[i+1];
        }
        this->size--;
    }
}




int main()
{
    Array<float> p;
    p.pushback(6.5);
    p.pushback(6.5);
    p.pushback(6.5);
    p.pushback(6.5);
    p.sertvalue(0,6.6);
    p.deletevalue(0);
    cout<<"数组为："<<endl;
    for(int i=0;i<p.getsize();i++){
        cout<<p.getvalue(i)<<" ";
    }
    cout<<endl;
    cout<<"数据个数:"<<p.getsize()<<endl;

}
